<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="渠道编号" prop="channelSource">
        <el-input
          v-model="queryParams.channelSource"
          placeholder="请输入渠道编号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="渠道名称" prop="channelName">
        <el-input
          v-model="queryParams.channelName"
          placeholder="请输入渠道名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="城市" prop="cityLimit">
        <el-input
          v-model="queryParams.cityLimit"
          placeholder="请输入城市"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <!-- <el-form-item label="金额限制" prop="applyLimit">
        <el-input
          v-model="queryParams.applyLimit"
          placeholder="请输入金额限制"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="年龄限制" prop="ageLimit">
        <el-input
          v-model="queryParams.ageLimit"
          placeholder="请输入年龄限制"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="每日接收数据上限" prop="dayLimit">
        <el-input
          v-model="queryParams.dayLimit"
          placeholder="请输入每日接收数据上限"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="不进库申请时间间隔" prop="rejectDays">
        <el-input
          v-model="queryParams.rejectDays"
          placeholder="请输入不进库申请时间间隔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="自动归到原客户经理的时间间隔" prop="autoFindDays">
        <el-input
          v-model="queryParams.autoFindDays"
          placeholder="请输入自动归到原客户经理的时间间隔"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="已上门的客户强提醒" prop="noticeVisitDays">
        <el-input
          v-model="queryParams.noticeVisitDays"
          placeholder="请输入已上门的客户强提醒"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="已签约的客户强提醒" prop="noticeSignDays">
        <el-input
          v-model="queryParams.noticeSignDays"
          placeholder="请输入已签约的客户强提醒"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="已放款的客户强提醒" prop="noticeLoanDays">
        <el-input
          v-model="queryParams.noticeLoanDays"
          placeholder="请输入已放款的客户强提醒"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否允许查看备注搜索明细(1-是, 2-否)" prop="detailsDisplay">
        <el-input
          v-model="queryParams.detailsDisplay"
          placeholder="请输入是否允许查看备注搜索明细(1-是, 2-否)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="是否允许查看urltrack明细(1-是, 2-否)" prop="urltrackDisplay">
        <el-input
          v-model="queryParams.urltrackDisplay"
          placeholder="请输入是否允许查看urltrack明细(1-是, 2-否)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="排序" prop="orderNum">
        <el-input
          v-model="queryParams.orderNum"
          placeholder="请输入排序"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="预留字段" prop="attr1">
        <el-input
          v-model="queryParams.attr1"
          placeholder="请输入预留字段"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="数据接收开通标志(1-开通,2-不开通)" prop="openFlag">
        <el-input
          v-model="queryParams.openFlag"
          placeholder="请输入数据接收开通标志(1-开通,2-不开通)"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="0星跟进中备注搜索间隔天数" prop="star0Status1Days">
        <el-input
          v-model="queryParams.star0Status1Days"
          placeholder="请输入0星跟进中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="2星已上门备注搜索间隔天数" prop="star2Status2Days">
        <el-input
          v-model="queryParams.star2Status2Days"
          placeholder="请输入2星已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="2星待签约备注搜索间隔天数" prop="star2Status3Days">
        <el-input
          v-model="queryParams.star2Status3Days"
          placeholder="请输入2星待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="2星已签约备注搜索间隔天数" prop="star2Status4Days">
        <el-input
          v-model="queryParams.star2Status4Days"
          placeholder="请输入2星已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="2星已放款备注搜索间隔天数" prop="star2Status5Days">
        <el-input
          v-model="queryParams.star2Status5Days"
          placeholder="请输入2星已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="2星审件中备注搜索间隔天数" prop="star2Status11Days">
        <el-input
          v-model="queryParams.star2Status11Days"
          placeholder="请输入2星审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="3星已上门备注搜索间隔天数" prop="star3Status2Days">
        <el-input
          v-model="queryParams.star3Status2Days"
          placeholder="请输入3星已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="3星待签约备注搜索间隔天数" prop="star3Status3Days">
        <el-input
          v-model="queryParams.star3Status3Days"
          placeholder="请输入3星待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="3星已签约备注搜索间隔天数" prop="star3Status4Days">
        <el-input
          v-model="queryParams.star3Status4Days"
          placeholder="请输入3星已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="3星已放款备注搜索间隔天数" prop="star3Status5Days">
        <el-input
          v-model="queryParams.star3Status5Days"
          placeholder="请输入3星已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="3星审件中备注搜索间隔天数" prop="star3Status11Days">
        <el-input
          v-model="queryParams.star3Status11Days"
          placeholder="请输入3星审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="4星已上门备注搜索间隔天数" prop="star4Status2Days">
        <el-input
          v-model="queryParams.star4Status2Days"
          placeholder="请输入4星已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="4星待签约备注搜索间隔天数" prop="star4Status3Days">
        <el-input
          v-model="queryParams.star4Status3Days"
          placeholder="请输入4星待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="4星已签约备注搜索间隔天数" prop="star4Status4Days">
        <el-input
          v-model="queryParams.star4Status4Days"
          placeholder="请输入4星已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="4星已放款备注搜索间隔天数" prop="star4Status5Days">
        <el-input
          v-model="queryParams.star4Status5Days"
          placeholder="请输入4星已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="4星审件中备注搜索间隔天数" prop="star4Status11Days">
        <el-input
          v-model="queryParams.star4Status11Days"
          placeholder="请输入4星审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5星客户已上门备注搜索间隔天数" prop="star5Status2Days">
        <el-input
          v-model="queryParams.star5Status2Days"
          placeholder="请输入5星客户已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5星客户待签约备注搜索间隔天数" prop="star5Status3Days">
        <el-input
          v-model="queryParams.star5Status3Days"
          placeholder="请输入5星客户待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5星客户已签约备注搜索间隔天数" prop="star5Status4Days">
        <el-input
          v-model="queryParams.star5Status4Days"
          placeholder="请输入5星客户已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5星客户已放款备注搜索间隔天数" prop="star5Status5Days">
        <el-input
          v-model="queryParams.star5Status5Days"
          placeholder="请输入5星客户已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="5星客户审件中备注搜索间隔天数" prop="star5Status11Days">
        <el-input
          v-model="queryParams.star5Status11Days"
          placeholder="请输入5星客户审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="荐介客户已上门备注搜索间隔天数" prop="star6Status2Days">
        <el-input
          v-model="queryParams.star6Status2Days"
          placeholder="请输入荐介客户已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="荐介客户待签约备注搜索间隔天数" prop="star6Status3Days">
        <el-input
          v-model="queryParams.star6Status3Days"
          placeholder="请输入荐介客户待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="荐介客户已签约备注搜索间隔天数" prop="star6Status4Days">
        <el-input
          v-model="queryParams.star6Status4Days"
          placeholder="请输入荐介客户已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="荐介客户已放款备注搜索间隔天数" prop="star6Status5Days">
        <el-input
          v-model="queryParams.star6Status5Days"
          placeholder="请输入荐介客户已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="荐介客户审件中备注搜索间隔天数" prop="star6Status11Days">
        <el-input
          v-model="queryParams.star6Status11Days"
          placeholder="请输入荐介客户审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷5星客户已上门备注搜索间隔天数" prop="star7Status2Days">
        <el-input
          v-model="queryParams.star7Status2Days"
          placeholder="请输入小贷5星客户已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷5星客户待签约备注搜索间隔天数" prop="star7Status3Days">
        <el-input
          v-model="queryParams.star7Status3Days"
          placeholder="请输入小贷5星客户待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷5星客户已签约备注搜索间隔天数" prop="star7Status4Days">
        <el-input
          v-model="queryParams.star7Status4Days"
          placeholder="请输入小贷5星客户已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷5星客户已放款备注搜索间隔天数" prop="star7Status5Days">
        <el-input
          v-model="queryParams.star7Status5Days"
          placeholder="请输入小贷5星客户已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷5星客户审件中备注搜索间隔天数" prop="star7Status11Days">
        <el-input
          v-model="queryParams.star7Status11Days"
          placeholder="请输入小贷5星客户审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷次级客户已上门备注搜索间隔天数" prop="star8Status2Days">
        <el-input
          v-model="queryParams.star8Status2Days"
          placeholder="请输入小贷次级客户已上门备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷次级客户待签约备注搜索间隔天数" prop="star8Status3Days">
        <el-input
          v-model="queryParams.star8Status3Days"
          placeholder="请输入小贷次级客户待签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷次级客户已签约备注搜索间隔天数" prop="star8Status4Days">
        <el-input
          v-model="queryParams.star8Status4Days"
          placeholder="请输入小贷次级客户已签约备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷次级客户已放款备注搜索间隔天数" prop="star8Status5Days">
        <el-input
          v-model="queryParams.star8Status5Days"
          placeholder="请输入小贷次级客户已放款备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="小贷次级客户审件中备注搜索间隔天数" prop="star8Status11Days">
        <el-input
          v-model="queryParams.star8Status11Days"
          placeholder="请输入小贷次级客户审件中备注搜索间隔天数"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="媒体类别代码" prop="channelTypeCode">
        <el-input
          v-model="queryParams.channelTypeCode"
          placeholder="请输入媒体类别代码"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item> -->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['crmsys:channelInfo:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['crmsys:channelInfo:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['crmsys:channelInfo:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['crmsys:channelInfo:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="channelInfoList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="ID" align="center" prop="id" />
      <el-table-column label="渠道编号" align="center" prop="channelSource" />
      <el-table-column label="渠道名称" align="center" prop="channelName" />
      <el-table-column label="城市" align="center" prop="cityLimit" />
      <el-table-column label="金额限制" align="center" prop="applyLimit" />
      <el-table-column label="年龄限制" align="center" prop="ageLimit" />
      <el-table-column label="每日接收数据上限" align="center" prop="dayLimit" />
      <el-table-column label="撞库方式(1-全库撞库, 2-按城市撞库)" align="center" prop="collisionType" />
      <el-table-column label="不进库申请时间间隔" align="center" prop="rejectDays" />
      <el-table-column label="自动归到原客户经理的时间间隔" align="center" prop="autoFindDays" />
      <el-table-column label="已上门的客户强提醒" align="center" prop="noticeVisitDays" />
      <el-table-column label="已签约的客户强提醒" align="center" prop="noticeSignDays" />
      <el-table-column label="已放款的客户强提醒" align="center" prop="noticeLoanDays" />
      <el-table-column label="是否允许查看备注搜索明细(1-是, 2-否)" align="center" prop="detailsDisplay" />
      <el-table-column label="是否允许查看urltrack明细(1-是, 2-否)" align="center" prop="urltrackDisplay" />
      <el-table-column label="排序" align="center" prop="orderNum" />
      <el-table-column label="渠道状态" align="center" prop="status" />
      <el-table-column label="预留字段" align="center" prop="attr1" />
      <el-table-column label="数据接收开通标志(1-开通,2-不开通)" align="center" prop="openFlag" />
      <el-table-column label="0星跟进中备注搜索间隔天数" align="center" prop="star0Status1Days" />
      <el-table-column label="2星已上门备注搜索间隔天数" align="center" prop="star2Status2Days" />
      <el-table-column label="2星待签约备注搜索间隔天数" align="center" prop="star2Status3Days" />
      <el-table-column label="2星已签约备注搜索间隔天数" align="center" prop="star2Status4Days" />
      <el-table-column label="2星已放款备注搜索间隔天数" align="center" prop="star2Status5Days" />
      <el-table-column label="2星审件中备注搜索间隔天数" align="center" prop="star2Status11Days" />
      <el-table-column label="3星已上门备注搜索间隔天数" align="center" prop="star3Status2Days" />
      <el-table-column label="3星待签约备注搜索间隔天数" align="center" prop="star3Status3Days" />
      <el-table-column label="3星已签约备注搜索间隔天数" align="center" prop="star3Status4Days" />
      <el-table-column label="3星已放款备注搜索间隔天数" align="center" prop="star3Status5Days" />
      <el-table-column label="3星审件中备注搜索间隔天数" align="center" prop="star3Status11Days" />
      <el-table-column label="4星已上门备注搜索间隔天数" align="center" prop="star4Status2Days" />
      <el-table-column label="4星待签约备注搜索间隔天数" align="center" prop="star4Status3Days" />
      <el-table-column label="4星已签约备注搜索间隔天数" align="center" prop="star4Status4Days" />
      <el-table-column label="4星已放款备注搜索间隔天数" align="center" prop="star4Status5Days" />
      <el-table-column label="4星审件中备注搜索间隔天数" align="center" prop="star4Status11Days" />
      <el-table-column label="5星客户已上门备注搜索间隔天数" align="center" prop="star5Status2Days" />
      <el-table-column label="5星客户待签约备注搜索间隔天数" align="center" prop="star5Status3Days" />
      <el-table-column label="5星客户已签约备注搜索间隔天数" align="center" prop="star5Status4Days" />
      <el-table-column label="5星客户已放款备注搜索间隔天数" align="center" prop="star5Status5Days" />
      <el-table-column label="5星客户审件中备注搜索间隔天数" align="center" prop="star5Status11Days" />
      <el-table-column label="荐介客户已上门备注搜索间隔天数" align="center" prop="star6Status2Days" />
      <el-table-column label="荐介客户待签约备注搜索间隔天数" align="center" prop="star6Status3Days" />
      <el-table-column label="荐介客户已签约备注搜索间隔天数" align="center" prop="star6Status4Days" />
      <el-table-column label="荐介客户已放款备注搜索间隔天数" align="center" prop="star6Status5Days" />
      <el-table-column label="荐介客户审件中备注搜索间隔天数" align="center" prop="star6Status11Days" />
      <el-table-column label="小贷5星客户已上门备注搜索间隔天数" align="center" prop="star7Status2Days" />
      <el-table-column label="小贷5星客户待签约备注搜索间隔天数" align="center" prop="star7Status3Days" />
      <el-table-column label="小贷5星客户已签约备注搜索间隔天数" align="center" prop="star7Status4Days" />
      <el-table-column label="小贷5星客户已放款备注搜索间隔天数" align="center" prop="star7Status5Days" />
      <el-table-column label="小贷5星客户审件中备注搜索间隔天数" align="center" prop="star7Status11Days" />
      <el-table-column label="媒体类别代码" align="center" prop="channelTypeCode" />
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['crmsys:channelInfo:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['crmsys:channelInfo:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改渠道信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="渠道编号" prop="channelSource">
          <el-input v-model="form.channelSource" placeholder="请输入渠道编号" />
        </el-form-item>
        <el-form-item label="渠道名称" prop="channelName">
          <el-input v-model="form.channelName" placeholder="请输入渠道名称" />
        </el-form-item>
        <el-form-item label="城市" prop="cityLimit">
          <el-input v-model="form.cityLimit" placeholder="请输入城市" />
        </el-form-item>
        <el-form-item label="金额限制" prop="applyLimit">
          <el-input v-model="form.applyLimit" placeholder="请输入金额限制" />
        </el-form-item>
        <el-form-item label="年龄限制" prop="ageLimit">
          <el-input v-model="form.ageLimit" placeholder="请输入年龄限制" />
        </el-form-item>
        <el-form-item label="每日接收数据上限" prop="dayLimit">
          <el-input v-model="form.dayLimit" placeholder="请输入每日接收数据上限" />
        </el-form-item>
        <el-form-item label="不进库申请时间间隔" prop="rejectDays">
          <el-input v-model="form.rejectDays" placeholder="请输入不进库申请时间间隔" />
        </el-form-item>
        <el-form-item label="自动归到原客户经理的时间间隔" prop="autoFindDays">
          <el-input v-model="form.autoFindDays" placeholder="请输入自动归到原客户经理的时间间隔" />
        </el-form-item>
        <el-form-item label="已上门的客户强提醒" prop="noticeVisitDays">
          <el-input v-model="form.noticeVisitDays" placeholder="请输入已上门的客户强提醒" />
        </el-form-item>
        <el-form-item label="已签约的客户强提醒" prop="noticeSignDays">
          <el-input v-model="form.noticeSignDays" placeholder="请输入已签约的客户强提醒" />
        </el-form-item>
        <el-form-item label="已放款的客户强提醒" prop="noticeLoanDays">
          <el-input v-model="form.noticeLoanDays" placeholder="请输入已放款的客户强提醒" />
        </el-form-item>
        <el-form-item label="是否允许查看备注搜索明细(1-是, 2-否)" prop="detailsDisplay">
          <el-input v-model="form.detailsDisplay" placeholder="请输入是否允许查看备注搜索明细(1-是, 2-否)" />
        </el-form-item>
        <el-form-item label="是否允许查看urltrack明细(1-是, 2-否)" prop="urltrackDisplay">
          <el-input v-model="form.urltrackDisplay" placeholder="请输入是否允许查看urltrack明细(1-是, 2-否)" />
        </el-form-item>
        <el-form-item label="排序" prop="orderNum">
          <el-input v-model="form.orderNum" placeholder="请输入排序" />
        </el-form-item>
        <el-form-item label="预留字段" prop="attr1">
          <el-input v-model="form.attr1" placeholder="请输入预留字段" />
        </el-form-item>
        <el-form-item label="数据接收开通标志(1-开通,2-不开通)" prop="openFlag">
          <el-input v-model="form.openFlag" placeholder="请输入数据接收开通标志(1-开通,2-不开通)" />
        </el-form-item>
        <el-form-item label="0星跟进中备注搜索间隔天数" prop="star0Status1Days">
          <el-input v-model="form.star0Status1Days" placeholder="请输入0星跟进中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="2星已上门备注搜索间隔天数" prop="star2Status2Days">
          <el-input v-model="form.star2Status2Days" placeholder="请输入2星已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="2星待签约备注搜索间隔天数" prop="star2Status3Days">
          <el-input v-model="form.star2Status3Days" placeholder="请输入2星待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="2星已签约备注搜索间隔天数" prop="star2Status4Days">
          <el-input v-model="form.star2Status4Days" placeholder="请输入2星已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="2星已放款备注搜索间隔天数" prop="star2Status5Days">
          <el-input v-model="form.star2Status5Days" placeholder="请输入2星已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="2星审件中备注搜索间隔天数" prop="star2Status11Days">
          <el-input v-model="form.star2Status11Days" placeholder="请输入2星审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="3星已上门备注搜索间隔天数" prop="star3Status2Days">
          <el-input v-model="form.star3Status2Days" placeholder="请输入3星已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="3星待签约备注搜索间隔天数" prop="star3Status3Days">
          <el-input v-model="form.star3Status3Days" placeholder="请输入3星待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="3星已签约备注搜索间隔天数" prop="star3Status4Days">
          <el-input v-model="form.star3Status4Days" placeholder="请输入3星已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="3星已放款备注搜索间隔天数" prop="star3Status5Days">
          <el-input v-model="form.star3Status5Days" placeholder="请输入3星已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="3星审件中备注搜索间隔天数" prop="star3Status11Days">
          <el-input v-model="form.star3Status11Days" placeholder="请输入3星审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="4星已上门备注搜索间隔天数" prop="star4Status2Days">
          <el-input v-model="form.star4Status2Days" placeholder="请输入4星已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="4星待签约备注搜索间隔天数" prop="star4Status3Days">
          <el-input v-model="form.star4Status3Days" placeholder="请输入4星待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="4星已签约备注搜索间隔天数" prop="star4Status4Days">
          <el-input v-model="form.star4Status4Days" placeholder="请输入4星已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="4星已放款备注搜索间隔天数" prop="star4Status5Days">
          <el-input v-model="form.star4Status5Days" placeholder="请输入4星已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="4星审件中备注搜索间隔天数" prop="star4Status11Days">
          <el-input v-model="form.star4Status11Days" placeholder="请输入4星审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="5星客户已上门备注搜索间隔天数" prop="star5Status2Days">
          <el-input v-model="form.star5Status2Days" placeholder="请输入5星客户已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="5星客户待签约备注搜索间隔天数" prop="star5Status3Days">
          <el-input v-model="form.star5Status3Days" placeholder="请输入5星客户待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="5星客户已签约备注搜索间隔天数" prop="star5Status4Days">
          <el-input v-model="form.star5Status4Days" placeholder="请输入5星客户已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="5星客户已放款备注搜索间隔天数" prop="star5Status5Days">
          <el-input v-model="form.star5Status5Days" placeholder="请输入5星客户已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="5星客户审件中备注搜索间隔天数" prop="star5Status11Days">
          <el-input v-model="form.star5Status11Days" placeholder="请输入5星客户审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="荐介客户已上门备注搜索间隔天数" prop="star6Status2Days">
          <el-input v-model="form.star6Status2Days" placeholder="请输入荐介客户已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="荐介客户待签约备注搜索间隔天数" prop="star6Status3Days">
          <el-input v-model="form.star6Status3Days" placeholder="请输入荐介客户待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="荐介客户已签约备注搜索间隔天数" prop="star6Status4Days">
          <el-input v-model="form.star6Status4Days" placeholder="请输入荐介客户已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="荐介客户已放款备注搜索间隔天数" prop="star6Status5Days">
          <el-input v-model="form.star6Status5Days" placeholder="请输入荐介客户已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="荐介客户审件中备注搜索间隔天数" prop="star6Status11Days">
          <el-input v-model="form.star6Status11Days" placeholder="请输入荐介客户审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷5星客户已上门备注搜索间隔天数" prop="star7Status2Days">
          <el-input v-model="form.star7Status2Days" placeholder="请输入小贷5星客户已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷5星客户待签约备注搜索间隔天数" prop="star7Status3Days">
          <el-input v-model="form.star7Status3Days" placeholder="请输入小贷5星客户待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷5星客户已签约备注搜索间隔天数" prop="star7Status4Days">
          <el-input v-model="form.star7Status4Days" placeholder="请输入小贷5星客户已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷5星客户已放款备注搜索间隔天数" prop="star7Status5Days">
          <el-input v-model="form.star7Status5Days" placeholder="请输入小贷5星客户已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷5星客户审件中备注搜索间隔天数" prop="star7Status11Days">
          <el-input v-model="form.star7Status11Days" placeholder="请输入小贷5星客户审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷次级客户已上门备注搜索间隔天数" prop="star8Status2Days">
          <el-input v-model="form.star8Status2Days" placeholder="请输入小贷次级客户已上门备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷次级客户待签约备注搜索间隔天数" prop="star8Status3Days">
          <el-input v-model="form.star8Status3Days" placeholder="请输入小贷次级客户待签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷次级客户已签约备注搜索间隔天数" prop="star8Status4Days">
          <el-input v-model="form.star8Status4Days" placeholder="请输入小贷次级客户已签约备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷次级客户已放款备注搜索间隔天数" prop="star8Status5Days">
          <el-input v-model="form.star8Status5Days" placeholder="请输入小贷次级客户已放款备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="小贷次级客户审件中备注搜索间隔天数" prop="star8Status11Days">
          <el-input v-model="form.star8Status11Days" placeholder="请输入小贷次级客户审件中备注搜索间隔天数" />
        </el-form-item>
        <el-form-item label="媒体类别代码" prop="channelTypeCode">
          <el-input v-model="form.channelTypeCode" placeholder="请输入媒体类别代码" />
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listChannelInfo, getChannelInfo, delChannelInfo, addChannelInfo, updateChannelInfo } from "@/api/crmsys/channelInfo";

export default {
  name: "ChannelInfo",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 渠道信息表格数据
      channelInfoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        channelSource: null,
        channelName: null,
        cityLimit: null,
        applyLimit: null,
        ageLimit: null,
        dayLimit: null,
        collisionType: null,
        rejectDays: null,
        autoFindDays: null,
        noticeVisitDays: null,
        noticeSignDays: null,
        noticeLoanDays: null,
        detailsDisplay: null,
        urltrackDisplay: null,
        orderNum: null,
        status: null,
        attr1: null,
        openFlag: null,
        star0Status1Days: null,
        star2Status2Days: null,
        star2Status3Days: null,
        star2Status4Days: null,
        star2Status5Days: null,
        star2Status11Days: null,
        star3Status2Days: null,
        star3Status3Days: null,
        star3Status4Days: null,
        star3Status5Days: null,
        star3Status11Days: null,
        star4Status2Days: null,
        star4Status3Days: null,
        star4Status4Days: null,
        star4Status5Days: null,
        star4Status11Days: null,
        star5Status2Days: null,
        star5Status3Days: null,
        star5Status4Days: null,
        star5Status5Days: null,
        star5Status11Days: null,
        star6Status2Days: null,
        star6Status3Days: null,
        star6Status4Days: null,
        star6Status5Days: null,
        star6Status11Days: null,
        star7Status2Days: null,
        star7Status3Days: null,
        star7Status4Days: null,
        star7Status5Days: null,
        star7Status11Days: null,
        star8Status2Days: null,
        star8Status3Days: null,
        star8Status4Days: null,
        star8Status5Days: null,
        star8Status11Days: null,
        channelTypeCode: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        channelSource: [
          { required: true, message: "渠道编号不能为空", trigger: "blur" }
        ],
        channelName: [
          { required: true, message: "渠道名称不能为空", trigger: "blur" }
        ],
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询渠道信息列表 */
    getList() {
      this.loading = true;
      listChannelInfo(this.queryParams).then(response => {
        this.channelInfoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        channelSource: null,
        channelName: null,
        cityLimit: null,
        applyLimit: null,
        ageLimit: null,
        dayLimit: null,
        collisionType: null,
        rejectDays: null,
        autoFindDays: null,
        noticeVisitDays: null,
        noticeSignDays: null,
        noticeLoanDays: null,
        detailsDisplay: null,
        urltrackDisplay: null,
        orderNum: null,
        status: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        attr1: null,
        openFlag: null,
        star0Status1Days: null,
        star2Status2Days: null,
        star2Status3Days: null,
        star2Status4Days: null,
        star2Status5Days: null,
        star2Status11Days: null,
        star3Status2Days: null,
        star3Status3Days: null,
        star3Status4Days: null,
        star3Status5Days: null,
        star3Status11Days: null,
        star4Status2Days: null,
        star4Status3Days: null,
        star4Status4Days: null,
        star4Status5Days: null,
        star4Status11Days: null,
        star5Status2Days: null,
        star5Status3Days: null,
        star5Status4Days: null,
        star5Status5Days: null,
        star5Status11Days: null,
        star6Status2Days: null,
        star6Status3Days: null,
        star6Status4Days: null,
        star6Status5Days: null,
        star6Status11Days: null,
        star7Status2Days: null,
        star7Status3Days: null,
        star7Status4Days: null,
        star7Status5Days: null,
        star7Status11Days: null,
        star8Status2Days: null,
        star8Status3Days: null,
        star8Status4Days: null,
        star8Status5Days: null,
        star8Status11Days: null,
        channelTypeCode: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加渠道信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getChannelInfo(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改渠道信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateChannelInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addChannelInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除渠道信息编号为"' + ids + '"的数据项？').then(function() {
        return delChannelInfo(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('crmsys/channelInfo/export', {
        ...this.queryParams
      }, `channelInfo_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
